
#include "Triangle.h"

Triangle::Triangle(int color_) : Polygon(), color(color_) {
	type = string("Triangle");
}

Triangle::Triangle(const Triangle & other) : Polygon(other), color(other.color){

}

string Triangle::getType(){
	return type;
}

Triangle::~Triangle() {
	std::cout << "Triangle destructor \n";
}

int Triangle::getColor(){
	return color;
}

int Triangle::getNumOfPoints(){
	if (this->getNumOfPoints() < 3) return -1;
	return this->getNumOfPoints();
}

void Triangle::addPoint(Point* p){
	if (Polygon::getNumOfPoints() == 3){
		cout <<"You can't add any more points to this Triangle\n";
	}else{
		Polygon::addPoint(p);
	}
}
